<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@page import="com.test.entity.Orders"%>
<%
String path= request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>购物记录</title>
<script  language="javascript">
	function showResult()
	{
		document.getElementById("result").style.display="block";
	}
</script>
<link  href="css/style.css"  rel="stylesheet" type="text/css"/>
</head>
<body>
<div  class="page">
<div  class="welcome wuser2">订单跟踪</div>
<form action="cart!showResult.action" method="post" name="form1">
<table width="200" border="0" cellspacing="0" cellpadding="0">
   <tr>
    <td height="58" colspan="4" class="firstRow" >请输入查询的订单号
      <input type="text" class="inp"  name="orderId" id="orderId"/><input type="submit" class="linkBtn" value="查询" onclick="showResult()"/></td>
    </tr>
	<!--查询结果-->
	<tr id="result" style="display: <%=request.getAttribute("listorList")==null?"none":request.getAttribute("listorList")%>" >
		<td>
		
			<table border="0" cellspacing="0" cellpadding="0">
				<tr>
					<td class="cm">订单编号</td>
					<td class="cm">购买时间</td>
				<!-- <td  class="cm">订单价格</td>  -->	
					<td class="cm">订单状态</td>
  				</tr>

  		<%
		List<Orders> orders=(List<Orders>)request.getAttribute("listorList");	
 				if(orders!=null){
 				String state="";
 				for(Orders order:orders){
 					if(order.getState()==1){
 					state="待审核";
 					}else if(order.getState()==2){
 					state="已审核";
 					}else if(order.getState()==3){
 					state="已付款";
 					}else if(order.getState()==4){
 					state="已发货";
 					}
 			%>
 				<tr>
					<td><%=order.getOrderId()%></td>
					<td ><%=order.getCreateTime() %></td>
				<!-- <td><span style="color:red;">￥0.00</span>元</td>  -->	
					<td ><span style="color:red;font-weight:bold;"><%=state%></span></td>
				  </tr>
				 <%}}%>
			</table>
		</td>
	</tr>
  	<!--查询结果end-->
</table>
</form>
</div>
</body>
</html>
